package fr.insta.webview.ui.util;

import java.awt.Component;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

/**
 * <p>TableColumnIcon class.</p>
 *
 * @author Maarek
 * @version $Id: $Id
 */
public class TableColumnIcon extends JLabel implements TableCellRenderer
{
	private static final long serialVersionUID = 1L;

	String url;

	/**
	 * <p>Constructor for TableColumnIcon.</p>
	 *
	 * @param _url a {@link java.lang.String} object.
	 */
	public TableColumnIcon(String _url)
	{
		url = _url;
	}

	/** {@inheritDoc} */
	@Override
	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col)
	{
		Icon cutIcon = new ImageIcon(url);
		setIcon(cutIcon);
		return this;
	}
}
